<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>setup (TestTunecoreDirect)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File test/test_tunecore_direct.rb, line 5</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
    <span class="ruby-constant">TunecoreDirect</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">tunecore_server</span> = <span class="ruby-value str">&quot;http://test.tunecore.com&quot;</span>
    <span class="ruby-constant">TunecoreDirect</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">api_key</span> = <span class="ruby-value str">&quot;testkey&quot;</span>
    
    <span class="ruby-comment cmt">#random email address so we dont get collisions after the first test</span>
    <span class="ruby-identifier">chars</span> = [<span class="ruby-value str">&quot;A&quot;</span><span class="ruby-operator">..</span><span class="ruby-value str">&quot;Z&quot;</span>,<span class="ruby-value str">&quot;a&quot;</span><span class="ruby-operator">..</span><span class="ruby-value str">&quot;z&quot;</span>,<span class="ruby-value str">&quot;0&quot;</span><span class="ruby-operator">..</span><span class="ruby-value str">&quot;9&quot;</span>].<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">to_a</span> }.<span class="ruby-identifier">join</span>
    <span class="ruby-ivar">@email</span> = (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">8</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-identifier">chars</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">chars</span>.<span class="ruby-identifier">size</span>)] }.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">&quot;C*&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;@domain.com&quot;</span> 
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>